<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<base href="<%=basePath%>">

<html>
    
    <head>
        <meta charset="utf-8">
        <title>
            阳光成单系统
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="System/css/x-admin.css" media="all">
    </head>
    
    <body>
        <div class="x-body">
              <form class="layui-form" method="post" action="employees/updateEmp">
                  <div class="layui-form-item" readonly="readonly">
                      <label for="employeesId" class="layui-form-label">
                          <span class="x-black">员工编号</span>
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" value="${employeesOne.employeesId}" id="employeesId" name="employeesId" required="" lay-verify="required"
                                 autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" readonly="readonly">
                      <label for="employeesName" class="layui-form-label">
                          <span class="x-black">姓&emsp;名</span>
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" value="${employeesOne.employeesName}" id="employeesName" name="employeesName" required="" lay-verify="required"
                                 autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <%--@declare id="employeesage"--%><label for="employeesAge" class="layui-form-label">
                      <span class="x-black">年&emsp;龄</span>
                  </label>
                      <div class="layui-input-inline">
                          <input class="layui-input" onkeyup="value=zhzs(this.value)" lay-verify="required|number" id="employeesAge" name="employeesAge"  value="${employeesOne.employeesAge}" maxlength="2">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label for="employeesAddress" class="layui-form-label">
                          <span class="x-black">地&emsp;址</span>
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="employeesAddress" name="employeesAddress" required="" lay-verify="required"
                                 autocomplete="off" class="layui-input" value="${employeesOne.employeesAddress}">
                      </div>
                  </div>
                  <div class="layui-form-item" readonly="readonly">
                      <label for="employeesUsername" class="layui-form-label">
                          <span class="x-black">账&emsp;号</span>
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="employeesUsername" name="employeesUsername" required="" lay-verify="required"
                                 autocomplete="off" class="layui-input" value="${employeesOne.employeesUsername}">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label for="employeesPhone" class="layui-form-label">
                          <span class="x-black">手机号</span>
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="employeesPhone" name="employeesPhone" required="" lay-verify="phone"
                                 autocomplete="off" class="layui-input" value="${employeesOne.employeesPhone}">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display:none;">
                      <label for="employeesEmil" class="layui-form-label">
                          <span class="x-black">邮&emsp;箱</span>
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="employeesEmil" name="employeesEmil" required="" lay-verify="email"
                                 autocomplete="off" class="layui-input" value="${employeesOne.employeesEmil}">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <%--@declare id="roles"--%><label for="roles" class="layui-form-label">
                      <span class="x-black">角&emsp;色</span>
                  </label>
                      <div class="layui-input-inline">
                          <select name="roles">
                              <option value="0">全部角色</option>
                              <option value="1">超级管理员</option>
                              <option value="2">仓库管理员</option>
                              <option value="3">入库员</option>
                              <option value="4">出库员</option>
                              <option value="5">物流管理员</option>
                              <option value="6">配送员</option>
                          </select>
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <%--@declare id="department"--%><label for="department" class="layui-form-label">
                      <span class="x-black">所在部门</span>
                  </label>
                      <div class="layui-input-inline">
                          <select name="department">
                              <option value="0">所有部门</option>
                              <option value="1">财务部</option>
                              <option value="2">人事部</option>
                              <option value="3">市场部</option>
                              <option value="4">仓储运输部</option>
                              <option value="5">总经理</option>
                          </select>
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <%--@declare id="l_repass"--%><label for="L_repass" class="layui-form-label">
                  </label>
                      <button  class="layui-btn" lay-filter="xiugai" lay-submit="" onclick="update()">
                          立即修改
                      </button>
                  </div>
              </form>
        </div>
        <script src="System/lib/layui/layui.js" charset="utf-8"></script>
        <script src="System/js/x-layui.js" charset="utf-8"></script>
        <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
            
              //自定义验证规则
              form.verify({
                nikename: function(value){
                  if(value.length < 5){
                    return '昵称至少得5个字符啊';
                  }
                }
              });

              //监听提交
              /*form.on('submit(add)', function(data){
                console.log(data);
                //发异步，把数据提交给java
                layer.alert("修改成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                });
                return false;
              });*/

            });
        </script>
        <script>
            //修改员工信息关闭当前页面
            function update(){
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
            }
        </script>
    </body>

</html>